import {
    getUser
} from '../../../api/myzone'
Page({
    data: {
        userInfo: {}
    },
    onLoad() {
        this.getMyzone();
    },
    async getMyzone() {
        const res = await getUser();
        res.createTime = this.formatTime(res.createTime)
        this.setData({
            userInfo: res
        })
    },
    formatTime(time) {
        var date = new Date(time)
        let Y = date.getFullYear() + '-';
        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
        let D = date.getDate() + ' ';
        return (Y + M + D)
    },
    onShareAppMessage() {
        return {};
    },
});